<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>请选择日期&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</title>
<link type="text/css" rel="StyleSheet" href="../css/datepicker.css">
<script language="javascript" type="text/javascript" src="../script/common.js"></script>
<script language="javascript" type="text/javascript" src="../script/datepicker.js"></script>
<script id="esc_enter" for="document" event="onkeydown()">
if(window.event.keyCode=="27"){parent.parent.close();}
if(window.event.keyCode=="13"){if(typeof backValue == "function"){backValue(true);}}
</script>
<script language="javascript" type="text/javascript">
var dp;
var tValue;
var dateInputId;
function init(){
	tValue = getPara("tValue");
	dateInputId = getPara("tId");
	if(dateInputId){}else{dateInputId = "beginDate";}
	if(tValue){
		if(Validator.isDate(tValue)){
			var n_y = new Number(tValue.substring(0,4));
			var n_m = new Number(tValue.substring(5,7)) - 1;
			var n_d = new Number(tValue.substring(8,10));
			var d = new Date(n_y,n_m,n_d);
		}
	}
	else
		var d = new Date();
	dp = new DatePicker(d);
	if(dateInputId.indexOf("AndTime") != -1){
		var timeDiv = document.createElement("center");
		document.body.appendChild(timeDiv);
	    var daysGrid = "<table border=0 cellspacing='3' cellpadding='0' width='100%' align='center' bgcolor='#D4D0C8'>";
	        daysGrid +="<form id='timeForm' name='timeForm' onsubmit='return false'>";
	        daysGrid +="<tr><td nowrap style='font-size:14px;font-weight:bold' width=60 align=center>时 间<font style='font-family:Arial;font-weight:bold'>:</font></td>";

	        daysGrid +="<td style='BORDER-LEFT: #808080 1px solid;BORDER-TOP: #808080 1px solid; BORDER-RIGHT: #FFFFFF 1px solid;BORDER-BOTTOM: #FFFFFF 1px solid;background-color:#FFF' width=100>";
	        daysGrid +="<table border=0 cellspacing='0' cellpadding='0' width='100' style='BORDER-LEFT: #808080 1px solid;BORDER-TOP: #808080 1px solid; BORDER-RIGHT: #D4D0C8 1px solid;BORDER-BOTTOM: #D4D0C8 1px solid;'>";
	        daysGrid +="<tr bgcolor='#FFFFFF'>";
			daysGrid +="<td style='width:40px;'></td>";
	        daysGrid +="<td><input type='text' name='hour' maxlength='2' onfocus=\"fnHandleFoucs(0,\'" + dateInputId + "\');\" onblur=\"fnHandleBlur(0,\'" + dateInputId + "\');\" onkeydown=\"fnHandleOnkeydown(\'" + dateInputId + "\',this)\" onkeypress='return fnHandleOnKeyPress();' style='font-size: 10pt;font-family: Arial;border: solid 0 black;background: transparent;width:18;height:16;margin:0px' value='00'></td>";
	        daysGrid +="<td width='1' style='font-size:10pt'>:</td>";
	        daysGrid +="<td><input type='text' name='minute' maxlength='2' onfocus=\"fnHandleFoucs(1,\'" + dateInputId + "\');\" onblur=\"fnHandleBlur(1,\'" + dateInputId + "\');\" onkeydown=\"fnHandleOnkeydown(\'" + dateInputId + "\',this)\" onkeypress='return fnHandleOnKeyPress();' style='font-size: 10pt;font-family: Arial;border: solid 0 black;background: transparent;width:18;height:16;margin:0px' value='00'></td>";
	        daysGrid +="<td width='1' style='font-size:10pt'>:</td>";
	        daysGrid +="<td><input type='text' name='second' maxlength='2' onfocus=\"fnHandleFoucs(2,\'" + dateInputId + "\');\" onblur=\"fnHandleBlur(2,\'" + dateInputId + "\');\" onkeydown=\"fnHandleOnkeydown(\'" + dateInputId + "\',this)\" onkeypress='return fnHandleOnKeyPress();' style='font-size: 10pt;font-family: Arial;border: solid 0 black;background: transparent;width:18;height:16;margin:0px' value='00'></td>";
	        daysGrid +="</tr>";
	        daysGrid +="</form>";
	        daysGrid +="</table>";
	        daysGrid +="</td><td>";
	        daysGrid +="<table border=0 cellspacing='0' cellpadding='0' width='16'>";
	        daysGrid +="<tr>";
	        daysGrid +="<td height='10' width='16' valign='top'><button class='upButton' onclick=\"fnHandleUp(\'" + dateInputId + "\');\"> </button></td>";
	        daysGrid +="</tr>";
	        daysGrid +="<tr>";
	        daysGrid +="<td height='8' width='16'><button class='downButton' onclick=\"fnHandleDown(\'" + dateInputId + "\');\"> </button></td>";
	        daysGrid +="</tr>";
	        daysGrid +="</table>";
	        daysGrid +="</td><td>&nbsp;</td></tr></table>";
	    timeDiv.innerHTML = daysGrid;
	    initTime(dateInputId);
    }
	document.body.appendChild(dp.create());
}
function backValue(){
	var backValue = "";
	if(dp.getDate() != null){
		var d = dp.getDate();
		var strMon = d.getMonth()+1;
		if(strMon < 10)
			strMon = "0" + strMon;
		var strDay = d.getDate();
		if(strDay < 10)
			strDay = "0" + strDay;
		backValue = d.getFullYear()+ "-" + strMon + "-" + strDay;
		if(dateInputId){
			if(dateInputId.indexOf("AndTime") != -1){
				backValue = backValue + " " + public_getTime();
			}
		}
	}
	if(isIE()){
		window.returnValue = backValue
	}
	else{
		var ipt = window.opener.$(dateInputId);
		if(ipt){
			ipt.value = backValue;
		}
	}
	window.close();
}
</script>
</head>
<body bgcolor="#FFFFFF" onload="init();">

</body>
</html>
